﻿using System.IO;
using System.Reflection;
using log4net.Config;

namespace Protobuf_Gui
{
    public static class LogNetConfig 
    {
        public static  void LoadLog4Net()
        {
            const string configFile = "Protobuf_Gui.log4net.config";

            var stream = Assembly.GetCallingAssembly().GetManifestResourceStream(configFile);
            if (stream == null)
            {
                throw new FileNotFoundException(string.Format("configuration file 'log4net.config' not found"));
            }

            XmlConfigurator.Configure(stream);
        }
    }
}
